<?php
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/


  defined('_JEXEC') or die('Retricted Access');
  
  JHTML::_('behavior.mootools');
  JHTML::_('behavior.tooltip');
  $user = JFactory::getUser();
  if (! class_exists ( 'JAStack' )&&! class_exists ( 'SmartTrim' ))
  	require_once(JPATH_COMPONENT_SITE.DS.'helper'.DS.'jahelper.php');
  global $jbconfig, $option;
  $Itemid = JRequest::getVar('Itemid', 1000);
?>
<script type="text/javascript">
/* <![CDATA[ */
var siteurl = '<?php echo JURI::root(); ?>';
	var Itemid = "<?php echo JRequest::getVar('Itemid');?>";
	var table_name = 'ja_jobs';
    function submitbutton(pressbutton,max, formName){
    	if (!check_list(max, formName))
    	{
    		if (pressbutton=='multi_starred')
    			alert('<?php echo JText::_('Please make a selection from the list to remove favorite'); ?>');
    		else
    			alert('<?php echo JText::_('Please make a selection from the list to view detail'); ?>');
    		return;
    	}
    	if(pressbutton=='multi_starred'){
    		if(confirm('<?php echo JText::_('Are you sure to remove this job from the list of favorites?')?>')){
    	        form.task.value = pressbutton;
    	        form.submit();
        	}
    		else return;
        }
        form.task.value = pressbutton;
        form.submit();
    }   

    /* ]]> */
</script>
<?php if(!JRequest::getInt('ajax', 0)){?>	
<script type="text/javascript">
/* <![CDATA[ */
	var itemid = '<?php echo JRequest::getVar('Itemid'); ?>';
	if(typeof( window[ 'filter' ] )== 'undifined'){
		var filter = new Array(0);
		var parent = new Array(0);
	}	
	
/* ]]> */
</script>
<?php }?>

<div id="jobboard-content">
<form name="adminForm" action="<?php echo JURI::root();?>index.php?option=com_jajobboard&view=jajobs&layout=jajobseekerlist&Itemid=<?php echo JRequest::getVar('Itemid'); ?>" method="post">    
<!--	All Job List-->
<?php if ($this->all_items) {?>
<?php 
			if(isset($this->fieldlist) && count($this->fieldlist)>0){
				jimport('joomla.filesystem.file');
				$theme = JRequest::getVar('theme');
				if (!$theme)
					$theme = $jbconfig['general']->get('theme', 'default');
				$path_themes = dirname(__FILE__).DS.'themes'.DS.$theme.DS.'jalist-item.php';
				if(JFile::exists($path_themes)&&$theme!='default'){
					if(file_exists(dirname(__FILE__).DS.'themes'.DS.$theme.DS.'style.css')){
				    	JHTML::stylesheet('style.css', "components/com_jajobboard/views/jajobs/tmpl/themes/$theme/");
				    }	
					include $path_themes;					
				}
				elseif(JFile::exists(dirname(__FILE__).DS.'themes'.DS.'default'.DS.'jajobseekerlist-item.php')){
					$path_themes = dirname(__FILE__).DS.'themes'.DS.'default'.DS.'jajobseekerlist-item.php';
					if(file_exists(dirname(__FILE__).DS.'themes'.DS.'default'.DS.'style.css')){
				    	JHTML::stylesheet('style.css', "components/com_jajobboard/views/jajobs/tmpl/themes/default/");
				    }	
				    include $path_themes;
				}
			}
			?>		
		
<?php } else { echo JText::_('You have not added any jobs to your favourite list! Please').' <a href="'.JRoute::_("index.php?option=com_jajobboard&view=jajobs&layout=jalist&Itemid=131").'">'.JText::_('click here').'</a> '.JText::_('to search and add job(s)');?>
<?php } ?>

	<input type="hidden" id="cids" name="cids[]" value="" />
	<input type="hidden" name="option" value="<?php echo $this->lists['option']; ?>" />
	<input type="hidden" name="view" value="jajobs" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="remove_starred" value="1" />
	<input type="hidden" name="table_name" value="<?php echo 'ja_jobs';?>" />
	<input type="hidden" name="boxchecked" id="boxcheckedadminForm" value="0" />
 	<input type="hidden" name="boxcheck" value="0" />
	<input type="hidden" id="filter_order" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
	<input type="hidden" id="filter_order_Dir" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
	<input type="hidden" name="layout" value="<?php echo $this->getLayout(); ?>" />
	<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid', 0); ?>" />
	<input type="hidden" name="field" value="" />
	<input type="hidden" name="pre_layout" value="jalist" />
 </form>
 </div>